home *** CD-ROM | disk | FTP | other *** search
/ One Click 21 (Special) / OC021.iso / Juegos / King of Skeleton / King of Skeleton.swf / scripts / __Packages / Sky.as < prev    next >
Encoding:
Text File  |  2006-02-02  |  954 b   |  41 lines

  1. class Sky extends MovieClip
  2. {
  3.    var yoff;
  4.    var sky;
  5.    var width;
  6.    var mvo;
  7.    var rad = Stage.width * 5 / 6.283185307179586;
  8.    var doScroll = true;
  9.    function Sky()
  10.    {
  11.       super();
  12.       if(!_root.brdcst)
  13.       {
  14.          _root.brdcst = {};
  15.          AsBroadcaster.initialize(_root.brdcst);
  16.       }
  17.       _root.brdcst.addListener(this);
  18.       this.yoff = this.sky._y;
  19.       this.sky._y = this.yoff;
  20.       this.width = this.sky._width - Vars.swidth;
  21.       this.mvo = (this._height - Stage.height) / 3;
  22.    }
  23.    function scrll(ha, va)
  24.    {
  25.       var _loc2_ = Math.round(this.rad * ha % this.width);
  26.       this._x = !(- (_loc2_ >= 0)) ? _loc2_ : _loc2_ - this.width;
  27.       this.sky._y = this.mvo * (- Math.tan(va)) + this.yoff;
  28.    }
  29.    function setScroll(s)
  30.    {
  31.       if(s != undefined)
  32.       {
  33.          this.doScroll = s;
  34.       }
  35.       else
  36.       {
  37.          this.doScroll = !this.doScroll;
  38.       }
  39.    }
  40. }
  41.